package com.ruoyi.partybuilding.common;

import com.ruoyi.common.core.redis.RedisCache;

import java.util.concurrent.Callable;

public class Cache implements org.springframework.cache.Cache {

    RedisCache cache;
    @Override
    public String getName() {

        return null;
    }

    @Override
    public Object getNativeCache() {
        return cache;
    }

    @Override
    public ValueWrapper get(Object key) {

        return null;
    }

    @Override
    public <T> T get(Object key, Class<T> type) {
        return (T)cache.getCacheObject(key+"");
    }

    @Override
    public <T> T get(Object key, Callable<T> valueLoader) {
        return null;
    }

    @Override
    public void put(Object key, Object value) {
        cache.setCacheObject(key+"",value);
    }

    @Override
    public void evict(Object key) {
        cache.deleteObject(key+"");
    }

    @Override
    public void clear() {

    }
}
